home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2002 November / SGI IRIX 6.5 Applications 2002 November.iso / dist / gateway.idb / usr / WebFace / Apps / major-archive.cgi.z / major-archive.cgi
Encoding:
Text File  |  2002-06-12  |  2.0 KB  |  61 lines

  1. #!/usr/bin/perl5
  2.  
  3. require "/usr/OnRamp/lib/OnRamp.pm";
  4.  
  5. open(IN, "< ../admin/majordomo_data");
  6. while (<IN>) {
  7.     chomp;
  8.     ($key, $val) = split(/=/);
  9.     $data{$key} = $val;
  10. }
  11. close(IN);
  12.  
  13. $list        = $ENV{'QUERY_STRING'};
  14. $archive_loc = "$document_root/apps/majordomo/$list";
  15. $num_file    = "$archive_loc/num";
  16.  
  17. if (-e $num_file) {
  18.     open(IN, "< $num_file");
  19.     $num = <IN>;
  20.     close(IN);
  21. } else { $num = 0; }
  22.  
  23. print "Content-type: text/html\n\n";
  24. &make_page;
  25.  
  26. sub make_page {
  27.     print "<html><head>"
  28.         . "<title>Majordomo message archives: $list</title></head>\n";
  29.     print "<body bgcolor=#B8E5C0 background=/apps/major.bg.gif>\n";
  30.     $title = "<h2>Majordomo message archives<br></h2>";
  31.  
  32.     print "<table width=100%><tr><th align=left><h2>$title</h2></th>\n",
  33.         "<th align=right><a href=\"/newsplash.shtml\">",
  34.         "<img height=55 width=57 border=0 src=/apps/home.gif></a>\n",
  35.         "  <a href=\"Apps.shtml\">",
  36.         "<img height=55 width=57 border=0 src=/apps/back.gif></a>",
  37.         "  <a href=\"/apps/Apps.major.cgi\">",
  38.         "<img height=60 width=80 border=0 src=\"/apps/major.gif\">",
  39.         "</tr></table><br><br>\n";
  40.  
  41.     if ($num <= 0) {
  42.         print "<center><table width=550>\n";
  43.         print "<tr><td align=center>There are no archived "
  44.             . "messages <br>in the \"$list\" mailing list.<br> "
  45.             . "</td></tr>\n";
  46.     } else {
  47.         print "There are $num archived messages in the \"$list\" "
  48.             . "mailing list.<p>\n";
  49.         print "<center><table width=550>\n<tr><td><ul>\n";
  50.         print "<li> <a href=\"majordomo/$list/date.html\">List archived "
  51.             . "messages by date</a><p>\n";
  52.         print "<li> <a href=\"majordomo/$list/subject.html\">List archived "
  53.             . "messages by subject</a><p>\n";
  54.         print "<li> <a href=\"majordomo/$list/author.html\">List archived "
  55.             . "messages by author</a><p>\n";
  56.         print "</ul><br></td></tr>\n";
  57.     }
  58.     print "</table></center>\n";
  59.     print "</body></html>\n";
  60. }
  61.